// 系统权限的接口
import axios from '../axios'
export default class system {
  //角色管理 ========================================
  static async myRoleGetRoleList(params) { //角色列表
    let res = await axios.post('/auth/role/getRoleList', params)
    return res.data
  }
  static async myInsertRole(params) { //角色新增
    let res = await axios.post('/auth/role/insertRole', params)
    return res.data
  }
  static async myGetListForDataPermission(params) { //数据权限下拉列表
    let res = await axios.post('/business/residentialQuarters/getListForDataPermission', params)
    return res.data
  }
  static async myGetRoleDetail(id) { //角色详情
    let res = await axios.get(`/auth/role/getRoleDetail?id=${id}`)
    return res.data
  }
  static async myDeleteRoleOnLogic(id) { //角色删除
    let res = await axios.get(`/auth/role/deleteRoleOnLogic?id=${id}`)
    return res.data
  }
  static async myUpdateRoleInfo(params) { //角色修改
    let res = await axios.post(`/auth/role/updateRoleInfo`, params)
    return res.data
  }

  //============================================角色管理




  // 用户管理 =========================================

  static async myInsertUser(params) { //用户新增
    let res = await axios.post('/auth/user/insertUser', params)
    return res.data
  }
  static async myUserGetRoleList(params) { //获取绑定角色列表
    let res = await axios.post('/auth/user/getRoleList', params)
    return res.data
  }
  static async myGetUnitByType(params) { //获取所属单位列表
    let res = await axios.post('/auth/department/getUnitByType', params)
    return res.data
  }
  static async myCheckAccount(account, id) { //校验手机号
    let res = await axios.get(`/auth/user/checkAccount?account=${account}&id=${id}`)
    return res.data
  }
  static async myGetUserInfoById(params) { //用户详情
    let res = await axios.post('/auth/user/getUserInfoById', params)
    return res.data
  }
  static async myGetUserList(params) { //用户列表
    let res = await axios.post('/auth/user/getUserList', params)
    return res.data
  }
  static async myUpdateUserInfoById(params) { //用户修改
    let res = await axios.post('/auth/user/updateUserInfoById', params)
    return res.data
  }
  // =======================================用户管理

  // 部门管理==========================================
  static async myInsertDepartment(params) { //部门新增
    let res = await axios.post('/auth/department/insertDepartment', params)
    return res.data
  }
  static async myUpdateDepartment(params) { //部门修改
    let res = await axios.post('/auth/department/updateDepartment', params)
    return res.data
  }

  //==============================================部门管理

  // 岗位管理=============================================
  static async myGetPostList(params) { //岗位列表
    let res = await axios.post('/business/post/list', params)
    return res.data
  }
  static async myAddPost(params) { //新增岗位
    let res = await axios.post('/business/post/insert', params)
    return res.data
  }
  static async myUpdatePost(params) { //修改岗位
    let res = await axios.post('/business/post/update', params)
    return res.data
  }
  static async myPostDetail(params) { //岗位详情
    let res = await axios.post(`/business/post/detail`, params)
    return res.data
  }
  static async myDeletePost(params) { //岗位删除
    let res = await axios.post(`/business/post/delete`, params)
    return res.data
  }
  static async myGetDepartmentList(params) { //所在部门列表
    let res = await axios.post(`/auth/department/getDepartmentList`, params)
    return res.data
  }

  static async myQueryAreaList(code) { //获取省市区

    let res = await axios.get(`/business/dictionary/queryAreaList?fatherCode=${code}`)
    return res.data
  }
  // ======================================================岗位管理

  static async myGetNationList(code) { //获取民族列表接口
    let res = await axios.get(`/business/dictionary/getNationList`)
    return res.data
  }
  static async myGetNationalityList(code) { //获取国籍列表接口
    let res = await axios.get(`/business/dictionary/getNationalityList`)
    return res.data
  }
}